Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preventing three Compute::getTargetTotalNP NPEs #3022

Merged

Conversation

Windchild292
Copy link
Contributor

@Windchild292 Windchild292 commented Jul 18, 2021

This was found in the megameklog.txt in #3005, and this fixes it and two other potential null issues.

java.lang.NullPointerException
	at megamek.common.Compute.getTargetTotalHP(Compute.java:2880)
	at megamek.client.bot.princess.FireControl.calcDamageAllocationUtility(FireControl.java:1402)
	at megamek.client.bot.princess.FireControl.calculateUtility(FireControl.java:1290)
	at megamek.client.bot.princess.FireControl.getFullFiringPlan(FireControl.java:1881)
	at megamek.client.bot.princess.FireControl.getBestFiringPlan(FireControl.java:2075)
	at megamek.client.bot.princess.FireControl.determineBestFiringPlan(FireControl.java:2210)
	at megamek.client.bot.princess.FireControl.getBestFiringPlan(FireControl.java:2439)
	at megamek.client.bot.princess.Princess.calculateFiringTurn(Princess.java:672)
	at megamek.client.bot.BotClient.calculateMyTurnWorker(BotClient.java:560)
	at megamek.client.bot.BotClient.calculateMyTurn(BotClient.java:517)
	at megamek.client.bot.BotClient$CalculateBotTurn.run(BotClient.java:110)
	at java.base/java.lang.Thread.run(Thread.java:829)

@Windchild292 Windchild292 self-assigned this Jul 18, 2021
@Windchild292 Windchild292 merged commit d54dcac into MegaMek:master Jul 18, 2021
@Windchild292 Windchild292 deleted the dev_Windchild_getTargetTotalHPNPE branch July 18, 2021 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants